//
//  DirectCollectionViewCell.m
//  LOLVideoPlayer
//
//  Created by SXW on 16/3/29.
//  Copyright © 2016年 盛宣伟. All rights reserved.
//

#import "DirectCollectionViewCell.h"
static CGFloat CELL_HEIGHT = 100;
@implementation DirectCollectionViewCell

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        _imageV  = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width / 2 - 15, 100)];
        [self.contentView addSubview:_imageV];
        
        _contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(_imageV.frame), APPScreenWidth / 2 - 15, 40)];
        _contentLabel.font = [UIFont systemFontOfSize:14];
        _contentLabel.numberOfLines = 0;
        [self.contentView addSubview:_contentLabel];
        
        _dateLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(_contentLabel.frame) + 2,APPScreenWidth / 2 - 15 , 10)];
        _dateLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_dateLabel];
    }
    return self;
}


-(void)configData:(DirectModel *)dataModel{
    
    [_imageV sd_setImageWithURL:[NSURL URLWithString:dataModel.img] placeholderImage:[UIImage imageNamed:@"default_head"]];
    _contentLabel.text = dataModel.name;
    
    _dateLabel.text = dataModel.updateTime;
}


+(CGFloat)getCellHeight{
    
    return CELL_HEIGHT;
}

@end
